#include<stdio.h>
#include<math.h>

double fact(double n);
int main()
{
    double x;
    scanf("%lf", &x);
    double y = 0.0, s = 0.0;
    double item = pow(x, y) / fact(y);
    while (item >= 1e-5)
    {
        s += item;
        y++;
        item = pow(x, y) / fact(y);
    }
    s += item;
    printf("%.4f", s);

    return 0;
}

double fact(double n)
{
    if (n == 1.0 || n == 0.0)
    {
        return 1;
    }
    else
    {
        return n * fact(n - 1);
    }
    
}